package com.sky.yipinyoufujava.service.imp;


import com.sky.yipinyoufujava.mapper.OrderMapper;
import com.sky.yipinyoufujava.pojo.from.GetSingleOrderGoodsFrom;
import com.sky.yipinyoufujava.pojo.from.OrderForm;
import com.sky.yipinyoufujava.pojo.goods.Goods;
import com.sky.yipinyoufujava.pojo.order.CreateOrder;
import com.sky.yipinyoufujava.pojo.order.Order;
import com.sky.yipinyoufujava.pojo.order.OrderStatus;
import com.sky.yipinyoufujava.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImp implements OrderService {
    @Autowired
    private OrderMapper orderMapper;

    @Override
    public List<Order> getOrder(OrderForm orderForm) {
        return orderMapper.getOrder(orderForm);
    }

    @Override
    public List<Goods> getSingleOrderGoods(GetSingleOrderGoodsFrom orderId) {
        return orderMapper.getSingleOrderGoods(orderId);
    }

    @Override
    public Order getSingleOrderInfo(GetSingleOrderGoodsFrom orderId) {
        return orderMapper.getSingleOrderInfo(orderId);
    }

    @Override
    public void createTemporaryOrder(CreateOrder createOrder) {
        orderMapper.createTemporaryOrder(createOrder);
    }

    @Override
    public void createOfficiallyOrder(Order order) {
        orderMapper.createOfficiallyOrder(order);
    }

    @Override
    public void updateOrderStatus(OrderStatus orderStatus) {
        orderMapper.updateOrderStatus(orderStatus);
    }

    @Override
    public void insertOrderGoodsList(String orderNumber,List<String> orderGoodsId) {
        orderMapper.insertOrderGoodsList(orderNumber,orderGoodsId);
    }

    @Override
    public void updateOrderInfo(Order order) {
        orderMapper.updateOrderInfo(order);
    }

}
